package com.xiaoxing.gongqiju.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.gongqiju.R;
import com.xiaoxing.gongqiju.mvp.ui.entity.LiaoCheng_GongQiJu_RuKuCaoZuo;

import java.util.List;

//import me.jessyan.armscomponent.commonres.utils.GlideUtil;


public class LiaoCheng_GongQiJu_RuKuCaoZuoAdapter extends BaseQuickAdapter<LiaoCheng_GongQiJu_RuKuCaoZuo.DataBean, BaseViewHolder> {

    private Context mContext;
    private ILiaoCheng_GongQiJu_RuKuCaoZuoAdapter iLiaoCheng_gongQiJu_ruKuCaoZuoAdapter;

    public LiaoCheng_GongQiJu_RuKuCaoZuoAdapter(Context context, @Nullable List<LiaoCheng_GongQiJu_RuKuCaoZuo.DataBean> data, ILiaoCheng_GongQiJu_RuKuCaoZuoAdapter iLiaoCheng_gongQiJu_ruKuCaoZuoAdapter) {
        super(R.layout.item_liao_cheng__gong_qi_ju__ru_ku_cao_zuo, data);
        this.mContext = context;
        this.iLiaoCheng_gongQiJu_ruKuCaoZuoAdapter = iLiaoCheng_gongQiJu_ruKuCaoZuoAdapter;
    }

    @Override
    protected void convert(BaseViewHolder helper, LiaoCheng_GongQiJu_RuKuCaoZuo.DataBean item) {
        //GlideUtil.loadImage(mContext,item.getImg(),helper.getView(R.id.img_head));
        helper.setText(R.id.tv_cang_wei_ming_cheng, "仓位名称:" + item.getSpname());
        helper.setText(R.id.tv_cang_wei_lei_xing, "仓位类型:" + item.getSptype());
        helper.setText(R.id.tv_cang_wei_di_zhi, "仓位地址:" + item.getSpadd());
        helper.setText(R.id.tv_cang_wei_bian_hao, "仓库编号:" + item.getSid());
        helper.setText(R.id.tv_cang_wei_zhuang_tai, "仓位状态:" + item.getSpstatus());
        helper.setText(R.id.tv_cang_wei_miao_shu, "仓位描述:" + item.getSpdes());
        helper.setText(R.id.tv_cang_wei_bei_zhu, "仓位备注:" + item.getSpremark());
        helper.setOnClickListener(R.id.btn_ru_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iLiaoCheng_gongQiJu_ruKuCaoZuoAdapter.ruKu(item);
            }
        });
        helper.setOnClickListener(R.id.btn_chong_xin_da_yin_er_wei_ma, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iLiaoCheng_gongQiJu_ruKuCaoZuoAdapter.chongXinDaYinErWeiMa(item);
            }
        });
    }

    public interface ILiaoCheng_GongQiJu_RuKuCaoZuoAdapter {

        void ruKu(LiaoCheng_GongQiJu_RuKuCaoZuo.DataBean item);

        void chongXinDaYinErWeiMa(LiaoCheng_GongQiJu_RuKuCaoZuo.DataBean item);
    }

}
